<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>BB量化交易系统</title>
	<link rel="icon" href="/static/images/bb-32.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="/static/images/bb-32.ico" type="image/x-icon"/>
	
	<link rel="stylesheet" type="text/css" href="/static/plugins/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="/static/plugins/easyui/themes/icon.css">
	<!-- <link rel="stylesheet" type="text/css" href="/static/plugins/easyui/demo/demo.css"> -->
	<script type="text/javascript" src="/static/plugins/easyui/jquery.min.js"></script>
	<script type="text/javascript" src="/static/plugins/inputmask/jquery.inputmask.bundle.min.js"></script>
	<script type="text/javascript" src="/static/plugins/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/static/plugins/easyui/extend/datagrid-groupview.js"></script> 
	<script type="text/javascript" src="/static/plugins/easyui/extend/datagrid-filter.js"></script> 
	<script type="text/javascript" src="/static/plugins/easyui/locale/easyui-lang-zh_CN.js"></script>
	<script type="text/javascript" src="/static/plugins/echarts/echarts.js"></script>
	<script type="text/javascript" src="/static/plugins/date/date-format.js"></script>
	<script type="text/javascript" src="/static/plugins/accounting/accounting.js"></script>
	
	
</head>
<body class="easyui-layout">
		<div data-options="region:'north'" style="height:50px;position:relative;">
			<!-- <h3 style="font-size:18px;position:absolute;left:50px;top:10px;margin:0 0 0 50px;">交易自动化管理系统</h3> -->
			<div class="easyui-panel" style="background:#E7F0FF;padding:8px;">
				<a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-main'" onclick="openTab('main','任务')" style="float:left;margin-left:70px;">任务</a>
				<a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-kline'" onclick="openTab('kline','行情')" style="float:left;margin-left:20px;">行情</a>
				<a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-order-list'" onclick="openTab('trades-list','订单')" style="float:left;margin-left:20px;">订单</a>
				<a href="#" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-assets'" onclick="openTab('balance-list','资产')" style="float:left;margin-left:20px;">资产</a>
				<a href="#" class="easyui-menubutton" style="float:right" data-options="menu:'#mm3',iconCls:'icon-help'">帮助</a>
				<a href="#" class="easyui-menubutton" style="float:right" data-options="menu:'#mm1',plain:true,iconCls:'icon-man'">${sessionScope.user.nickname }</a>
			</div>
			<img src="/static/images/bb-128.png" style="position: absolute;left:20px;top:2px;width:50px;height:40px;"></div>
			<div id="mm1" style="width:150px;">
					<div id="userConfig">用户设置</div>
					<div id="keyConfig">API配置</div>
					<div class="menu-sep"></div>
					<div id="logout">退出</div>
				</div>
			<div id="mm3" style="width:150px;">
				<div>帮助</div>
				<div>
					<span>关于</span>
					<div class="menu-content" style="padding:10px;text-align:left">
						<img src="/static/images/bb-128.png" >
						<p style="font-size:14px;color:#444">BB量化交易系统 v1.1</p>
					</div>
				</div>
			</div>
		</div>
		<div data-options="region:'south',border:false" style="height:50px;background:#222222;line-height:50px;text-align:center">
			<span style="color: #f7f8fa;letter-spacing:10px;">币市有风险 投资需谨慎</span>		
		</div>
		<div data-options="region:'center'">
			<div id="tabs" class="easyui-tabs" data-options="fit:true,border:false,plain:true,tabWidth:100,">
				<div title="任务" data-options="href:'main',iconCls:'icon-main'" ></div>
			</div>
		</div>
		
		<div id="window_keyPair"></div>  
</body>
<script type="text/javascript">

function openTab(url,text){
	var tabs = $("#tabs");
	var tab = tabs.tabs("getTab",text);
	if(tab){
		tabs.tabs("select",text);
	}else{
		if(url){
			
			var className;
			if(text == '行情'){
				className = 'icon-kline';
			}else if(text == '订单'){
				className = 'icon-order-list';
			}else if(text == '资产'){
				className = 'icon-assets';
			}
			
			tabs.tabs('add',{
			    title:text,
			    href: url,
			    iconCls: className,
			    closable:true,
			    bodyCls:"content"
			});
		}
		
	}
	
	
}
function menuHandler(item){
	var tabs = $("#tabs");
	var tab = tabs.tabs("getTab",item.text);
	if(tab){
		tabs.tabs("select",item.text);
	}else{
		if(item.url){
			tabs.tabs('add',{
			    title:item.text,
			    href: item.url,
			    closable:true,
			    bodyCls:"content"
			});
		}
		
	}
}


$("#keyConfig").click(function(){
	$('#window_keyPair').dialog({    
	    title: '密钥配置',    
	    width: 600,    
	    closed: false,    
	    cache: false,
	    resizable:true,
	    minimizable:true,
	    maximizable:true,
	    href: './key-pair',    
	    modal: false
	});    
})


$("#logout").click(function(){
	window.location.href="../user/logout";
})
		
		
		




		
</script>
</html>